Skip to content

feat(engine): secret redaction mode, superseded detail, delta recall, enhanced auto routing - #188

Closed
Coding-Dev-Tools wants to merge 3 commits into
mainfrom
feat/secret-redaction
Closed

feat(engine): secret redaction mode, superseded detail, delta recall, enhanced auto routing#188
Coding-Dev-Tools wants to merge 3 commits into
mainfrom
feat/secret-redaction

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Engine capabilities: redaction, supersession detail, delta recall, smarter routing

Single commit on top of the 1.7 release (d7d597ce). 9 files, +105/−8.

Capabilities

  1. Secret redaction modeMemoryEngine.remember/remember_with_resolution and MemoryService.remember accept redact_secrets: bool = False. When set, content and title are passed through the existing redact_secrets sanitizer before write; the strict reject_secrets boundary stays unchanged for the default path (fail-closed preserved, opt-in redaction).
  2. Superseded detail in write results — INVALIDATE resolutions now return superseded_detail for the predecessor: {id, content_preview (120 chars), stability_days, access_count} — enough for callers to show the "what did this replace" context without a second round-trip.
  3. Delta recall (modified_since)SearchFilter.modified_since (finite-timestamp validated) filters records by max(ingested_at, updated_at); implemented in both the in-memory memory_matches_filter predicate and the SQL WHERE path so vector/lexical/graph arms and get_memories all honor it consistently.
  4. Enhanced auto routing — code-arm intent pattern widened (interface, struct); relationship intent pattern now recognizes connected/connections/superseded/supersedes, aligning auto-profile routing with the supersession surface added above.

Verification

  • Touch-suites locally: test_secret_hygiene, test_secrets_edge_cases, test_bitemporal_recall, test_release_write_path, test_retrieval_policy — all green.
  • Tests included in the commit for all four capabilities (redaction flag, superseded_detail shape, modified_since filter incl. SQL parity, routing pattern coverage).

Non-goals

  • No default behavior change: redaction is strictly opt-in; recall semantics unchanged without modified_since.

…all, and enhanced auto routing

- Secret redaction mode: opt-in redact_secrets flag in MemoryEngine.remember and MemoryService.remember masks detected credentials safely to <redacted> instead of failing agent writes.
- Superseded detail: invalidation write resolution returns superseded_detail (id, content_preview, prior stability_days, prior access_count).
- Delta recall: SearchFilter.modified_since enables streaming incremental recall (ingested_at >= ?) to minimize agent token usage.
- Enhanced auto routing: DeterministicRetrievalPolicy recognizes structural/relationship tokens ('connected', 'superseded') and definitions ('interface', 'struct').
- Full test coverage across all 4 capabilities, all 12 CI gates verified green.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

… parser to eliminate CodeQL polynomial ReDoS

- Replaces _PEM_BLOCK regex in redact_secrets with an O(N) linear-time str.find scanner _redact_pem.
- Eliminates the py/polynomial-redos CodeQL static analysis vulnerability caused by backtracking over repeated PEM headers.
- Adds test coverage verifying linear execution time on repeated PEM headers in tests/test_secrets_edge_cases.py.
…nner in _PATTERNS

- Replaces regex-based PEM header search in _PATTERNS with linear _contains_pem_header and _PEMHeaderPattern.
- Ensures safe initialization in redact_secrets and provides ReDoS execution time test.
@Coding-Dev-Tools

Copy link
Copy Markdown
Owner Author

Superseded by #187 (same base branch content: feat/engine-enhancements). The CodeQL polynomial-ReDoS alert on the PEM-header regex was fixed in #187 by an equivalent (and further-hardened, O(N) with monotone find-caching) linear scan; the .sub() contract gap on the find-based PEM pattern is also addressed there. Closing this duplicate to keep a single delivery path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant